<template>
  <div class="person">
    <h2>我是Person组件</h2>
    <h4>姓名：{{name}}</h4>
    <h4>年龄：{{age}}</h4>
    <h4>座驾颜色：{{car.color}}</h4>
    <h4>座驾价格：{{car.price}}</h4>
    <button @click="changeAge(age+1)">点我年龄+1</button>
  </div>
</template>

<script>
  export default {
    name:'Person',
    // 第一种接收方式 —— 纯接收
    props:['car','name','age','changeAge']
  }
</script>

<style scoped>
  .person {
    background-color: skyblue;
    padding: 10px;
  }
</style>